package com.xmy.cultivate.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xmy.cultivate.entity.TrainAuditTeacherDetail;
import com.xmy.cultivate.entity.TrainExcludeTeacher;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 排除需要统计的教师 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2025-08-17
 */
public interface TrainExcludeTeacherMapper extends BaseMapper<TrainExcludeTeacher> {


    @Select({ "<script>",
            "SELECT" ,
                    "*," ,
                    "getStaffNameForId(teacher_id) AS teacher_name," ,
                    "getSubjectsName(subjects_id) AS subjects_name" ,
                    "FROM" ,
                    "train_exclude_teacher " ,
                    "WHERE" ,
                    "video_type = ${videoType}" ,
            "<when test='yearPart!=null and yearPart!=&apos;&apos; '>",
            "AND year_part = ${yearPart} ",
            "</when>",
            "<when test='quarterNum!=null and quarterNum!=&apos;&apos; '>",
            "AND quarter_num = ${quarterNum} ",
            "</when>",
                    "ORDER BY created_at DESC",

            "</script>"})

    public IPage<TrainExcludeTeacher> getTrainExcludeTeacherList(IPage<TrainExcludeTeacher> page,
                                                                 @Param("teacherName") String teacherName,
                                                                 @Param("videoType") String videoType,
                                                                 @Param("subjectsId") Long subjectsId,
                                                                 @Param("yearPart") String yearPart,
                                                                 @Param("quarterNum") String quarterNum);

}
